<ion-view view-title={{moduleTitle}}>
    <ion-nav-buttons side="left">
        <a class="button button-icon ion-arrow-left-c" href="#/tabs/main"></a>
    </ion-nav-buttons>
    <ion-nav-buttons side="right">
        <button class="button button-icon ion-ios-trash" ng-click="toggleDelete()">
        </button>
        <button class="button button-icon ion-navicon" ng-click="toggleRight()"
                ng-hide="$exposeAside.active"></button>
    </ion-nav-buttons>

    <ion-side-menus>
        <div class="tabs-striped tabs-top">
            <div class="tabs">
                <a ng-if="access.list" ng-class="{'tab-item':true,'active': true }" href="#/{{moduleName}}/list">查看</a>
                <a ng-if="access.add" ng-class="{'tab-item':true,'active': false }" href="#/{{moduleName}}/0">添加</a>
            </div>
        </div>
        <ion-side-menu-content>
            <ion-content class="padding has-tabs-top">
                <ion-refresher pulling-text="下拉刷新" pulling-icon="ion-loading-c" refreshing-text="刷新成功"
                               refreshing-icon="ion-loading-c" on-refresh="loadList(true)">
                </ion-refresher>
                <ion-list class="list" show-delete="showDelete">
                    <ion-item ng-repeat="item in farmerList | orderObjectById:'farmer_id':true"
                              href="#/{{moduleName}}/{{item.farmer_id}}">
                        <!--{{item.monthly_report_id}}-->
                        <h2>{{ item.province+item.city+item.county+item.town+item.village }}</h2>
                        <p>农户：{{item.farmer_name}}</p>
                        <ion-delete-button class="ion-minus-circled"
                                           ng-click="onItemDelete(item)">
                        </ion-delete-button>
                    </ion-item>

                    <div ng-if="listEnd" class="text-center">
                        已显示所有数据
                    </div>
                </ion-list>
                <ion-infinite-scroll ng-if="!listEnd" on-infinite="loadList(false)" distance="1%"></ion-infinite-scroll>
            </ion-content>
        </ion-side-menu-content>

        <ion-side-menu expose-aside-when="large" side="right">
            <ion-content class="has-tabs-top">
                <div class="list">

                    <insert-address addressoption="addressOption"></insert-address>

                    <button class="button button-block button-positive" ng-click="filterList()">
                        筛选
                    </button>
                </div>
            </ion-content>
        </ion-side-menu>

    </ion-side-menus>
</ion-view>